package framework.util;

import java.io.Serializable;

public class DirectedEdge implements Serializable {
	protected final Node targetNode;
	protected final String path;
	
	public DirectedEdge(String path, Node targetNode) {
		super();
		this.targetNode = targetNode;
		this.path = path;
	}
	
	public Node getTargetNode() {
		return targetNode;
	}

	public String getPath() {
		return path;
	}
	
	@Override
	public boolean equals(Object arg0) {
		if (arg0 instanceof DirectedEdge) {
			DirectedEdge other = (DirectedEdge) arg0;
			boolean equal = this.targetNode.equals(other.targetNode) &&
								this.path.equals(other.path);
			return equal;
		}
		return false;
	}


	@Override
	public int hashCode() {
		int hash = 7;
		hash = 31 * hash + this.targetNode.hashCode();
		hash = 31 * hash + this.path.hashCode();
		return hash;
	}

	@Override
	public String toString() {
		return this.path;
	}
}
